<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?python
colors = ["green", "red", "darkgrey"]
protocol = ["PyHMon", "IRC", "SNMP","","","","","","","","PyHMon SSL", "IRC SSL"]
?>

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
    py:extends="'master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
<title>Node list - PyHMon Web Interface</title>
</head>
<body>
    <span py:if="int(server[0]) != 0">
	<h2>Nodes under the server "${server[1]}"</h2>
	<form action="add_node" method="post">
	<input type = "hidden" name = "srvid" value = "${server[0]}"/>
	Add node: <select name="node">
	    <option py:for="n in allnode" value="${n.node_id}">
		${n.name}</option>
        </select>
	<input type="submit" name="submit" value="Add"/>
	</form>
    </span><span py:if="int(server[0]) == 0">
	<h2>Nodes</h2>
	<a href="${tg.url('/node_opts')}">Add node</a>
    </span>
    <table border="1" width = "100%">
	<tr>
	<th>Name</th><th>Address</th><th>Port</th><th>Proto</th><th>Plugins</th>
	<th>Edit</th><th>Plugins</th>
	<span py:if="int(server[0]) == 0"><th>Delete</th></span>
	<span py:if="int(server[0]) != 0"><th>Remove</th></span>
        </tr>
	<tr py:for="n in nodes"><td>
	    <font py:attrs="{'color':colors[n.status]}"><b>
            <span py:replace="n.name">Name Here.</span>
	    </b></font>
	</td><td>
	    <span py:replace="n.addr">Address Goes Here</span>
	</td><td>
	    <span py:replace="n.port">Port Goes Here</span>
        </td><td>
	    <span py:replace="protocol[n.proto]">Protocol Goes Here</span>
        </td><td>
	    <span py:replace="len(n.plugins)">Plugin numb. Goes Here</span>
	</td><td>
	<form action="node_opts" method="post">
            <input type="hidden" name="nodeid" value="${n.node_id}"/>
            <input type="submit" name="submit" value="Go!"/>
        </form>
	</td><td>
	<form action="plug_list" method="post">
            <input type="hidden" name="nodeid" value="${n.node_id}"/>
            <input type="submit" name="submit" value="Go!"/>          
        </form>
	</td><td>
	<form action="del_node" method="post">
            <input type="hidden" name="nodeid" value="${n.node_id}"/>
            <input type="hidden" name="srvid" value="${server[0]}"/>
            <input type="submit" name="submit" value="Go!"/>          
        </form>
	</td></tr>
    </table>
</body>
</html>
